/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.amazon.tree;

import com.amazon.node.Node;
import com.amazon.node.Operator;

/**
 *
 * @author Salman Noor, Shcool of Electrical and Information Engineering
 * @Copyright: Wits University 2013 - All Rights Reserved
 * @email salmannoor74415@gmail.com
 * @License BSD License (http://www.linfo.org/bsdlicense.html)
 */
public class Tree {
    private Node rootNode;

    public Tree(String operator,Node leftNode,Node rightNode) throws InstantiationException {
        this.rootNode = new Operator(operator,leftNode,rightNode);
    }
    
    public Integer solveTree(){
        return this.rootNode.evaluate();
    }
    
    
}
